home *** CD-ROM | disk | FTP | other *** search
- Path: news.chevron.com!news
- From: gacwra@hsun13.hou281.chevron.com (C.W.Racer)
- Newsgroups: comp.lang.c
- Subject: Re: big endian, little endian
- Date: 18 Apr 1996 15:28:38 GMT
- Organization: Chevron
- Sender: gacwra@hsun13 (C.W.Racer)
- Message-ID: <4l5n36$qk8@hsun27.chevron.com>
- References: <4ku9dm$t1t@news.ycc.yale.edu> <3172C1E9.3E95@willows.com>
- NNTP-Posting-Host: hsun13.hou281.chevron.com
-
- In article <3172C1E9.3E95@willows.com>, Tarang Deshpande <tarang@willows.com> writes:
- |> rmurphy wrote:
- |> >
- |> > Hi. I'm a graduate student doing research in computer music, and i
- |> > have a small tech question I can't seem to get answered in the c
- |> > reference books. What is the difference between big-endian and
- |> > little-endian? I know it relates somehow to signed/unsigned integers,
- |> > and the division between ibm & 68k-based platforms, but have no clue
- |> > beyond that. Thanks.
- |> > rmurphy@minerva.cis.yale.edu
- |>
- |>
- |> Actually it has nothing to with signed/unsigned integer rather it has to
- |> do with how integers are represented in memory on different platforms.
- |> In the representation of a two byte integer the question becomes is the
- |> high byte or the low byte at the lower or higher address. If the
- |> low byte is at the lower address then it uses little endian whereas if
- |> the high byte is at the lower address then it used big endian.
- |>
- |> So the number 256 which is 0000000100000000 in binary can be thought off
- |> as 00000001 * 256 + 00000000 where the 00000001 is the high byte and
- |> 00000000 is the low byte. On a little endian platform memory would look
- |> like 0000000000000001 whereas on a big endian platform memory would look
- |> like 0000000100000000.
- |>
- Actually the representation is the same, only the byte numbering is
- different.
-
- --
- | Chick Racer Chevron Petroleum Technology Co. |
- | (713) 596-2430 P.O. Box 42832 |
- | gacwra@chevron.com Houston, Tx 77242-2832 |
- | 4119 Hayes Rd. |
-